home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / Draw / Sources / DrwDDCmd.h < prev    next >
Encoding:
Text File  |  1996-12-16  |  3.8 KB  |  137 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                DrwDDCmd.h
  4. //    Release Version:    $ ODF 3 $
  5. //
  6. //    Author:                Mary Boetcher
  7. //
  8. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  9. //
  10. //========================================================================================
  11.  
  12. #ifndef DRWDDCMD_H
  13. #define DRWDDCMD_H
  14.  
  15. #ifndef DRAWLINK_H
  16. #include "DrawLink.h"
  17. #endif
  18.  
  19. // ----- FrameWork Includes -----
  20.  
  21. #ifndef FWDRCMD_H
  22. #include "FWDrCmd.h"
  23. #endif
  24.  
  25. //========================================================================================
  26. //    Forward Declarations
  27. //========================================================================================
  28.  
  29. class CDrawPart;
  30. class CDrawSelection;
  31. class CDrawSubscribeLink;
  32. class CDrawLinkManager;
  33. class CBaseShape;
  34. class CDrawContent;
  35. class CDrawUndoContent;
  36.  
  37. //========================================================================================
  38. // class CDrawDragCommand - for dragging
  39. //========================================================================================
  40.  
  41. class CDrawDragCommand : public FW_CDragCommand
  42. {
  43.   public:
  44.  
  45.     FW_DECLARE_AUTO(CDrawDragCommand)
  46.  
  47.     CDrawDragCommand(Environment* ev, 
  48.                      CDrawPart* part,
  49.                      FW_CFrame* frame,
  50.                      CDrawSelection* selection,
  51.                      FW_Boolean canUndo);
  52.  
  53.     virtual ~CDrawDragCommand();
  54.  
  55.     // --- FW_CCommand overrides
  56.     virtual void         UndoIt(Environment* ev);
  57.     virtual void         RedoIt(Environment* ev);
  58.     virtual void         SaveUndoState(Environment* ev);
  59.     virtual void         FreeUndoState(Environment *ev);
  60.     
  61.     virtual void          PropagateChanges(Environment* ev, ODUpdateID id = kODUnknownUpdate);
  62.     virtual void          DoIt(Environment* ev);
  63.  
  64.   protected:
  65.     CDrawPart*            fDrawPart;
  66.     CDrawSelection*        fDrawSelection;
  67.     CDrawUndoContent*    fDraggedContent;
  68.     ODShape*            fUpdateShape;
  69.     CDrawPublishLinkCollection* fLinkSources;
  70. };
  71.  
  72. //========================================================================================
  73. // class CDrawDropCommand - for dropping
  74. //========================================================================================
  75.  
  76. class CDrawDropCommand : public FW_CDropCommand
  77. {
  78.   public:
  79.   
  80.     FW_DECLARE_AUTO(CDrawDropCommand)
  81.  
  82.     CDrawDropCommand(Environment* ev, 
  83.                      CDrawPart* itsPart,
  84.                      FW_CFrame* frame,
  85.                      ODDragItemIterator* dropInfo, 
  86.                      ODFacet* facet, 
  87.                      const FW_CPoint& windowPoint,
  88.                      FW_Boolean canUndo);
  89.  
  90.     virtual ~ CDrawDropCommand();
  91.  
  92.     virtual void             UndoIt(Environment* ev);            // Override
  93.     virtual void             RedoIt(Environment* ev);            // Override
  94.     virtual void FreeUndoState(Environment* ev);        // Override
  95.     virtual void             SaveRedoState(Environment* ev);        // Override
  96.  
  97.     // --- FW_CDropCommand overrides
  98.     virtual FW_Boolean         DoDrop(Environment* ev, 
  99.                                 ODStorageUnit* dropSU, 
  100.                                 const FW_CPoint& mouseDownOffset, 
  101.                                 const FW_CPoint& dropPoint, 
  102.                                 FW_Boolean isDropMove,
  103.                                 short itemNumber);
  104.                                 
  105.     virtual FW_Boolean        DoDroppedInSameFrame(Environment* ev, 
  106.                                 ODStorageUnit* dropSU, 
  107.                                 const FW_CPoint& mouseDownOffset, 
  108.                                 const FW_CPoint& dropPoint);
  109.                                 
  110.     virtual void             DoDroppedPasteAs(Environment* ev, 
  111.                                 const FW_CPoint& mouseDownOffset,
  112.                                 const FW_CPoint& dropPoint);
  113.     virtual void             PropagateChanges(Environment* ev, 
  114.                                 ODUpdateID id = kODUnknownUpdate);
  115.     virtual void  SaveUndoState(Environment* ev); //Override
  116.  
  117.      //Override
  118.  
  119.  
  120.   private:
  121.     void                     OffsetSelection(Environment* ev, const FW_CPoint& delta);
  122.     void                     RestoreDroppedShapes(Environment* ev);
  123.  
  124.     CDrawLinkManager*         GetDrawLinkManager(Environment* ev) const;
  125.  
  126.   private:
  127.     CDrawPart*                fDrawPart;
  128.     CDrawSelection*            fDrawSelection;
  129.     FW_CPoint                fDropDelta;
  130.     CDrawUndoContent*        fDroppedContent;
  131.     CDrawContent*            fSavedSelection;
  132.     CDrawSubscribeLink*        fSavedLink;
  133. };
  134.  
  135.  
  136. #endif
  137.